import request from '@/utils/request'

// 登录 用户列表
export const adminLogin = (data) =>
  request({
    method: 'POST',
    url: '/user/login',
    data
  })

// 退出 用户功能
export const adminLogout = () =>
  request({
    method: 'POST',
    url: '/user/logout'
  })

// /user 获取用户信息
export const getUserInfo = () =>
  request({
    method: 'GET',
    url: '/user'
  })

// 添加收藏
export const addCollect = (id) =>
  request({
    method: 'POST',
    url: `/user/favorites/${id}`
  })

// 取消收藏
export const removeCollect = (id) =>
  request({
    method: 'DELETE',
    url: `/user/favorites/${id}`
  })

// 获取收藏列表
export const getFavoriteApi = () =>
  request({
    url: '/user/favorites'
  })

// 获取发布房源列表
export const getRentApi = () =>
  request({
    url: '/user/houses'
  })

//  发布房源
export const sendHouseInfo = (data) =>
  request({
    url: '/user/houses',
    method: 'POST',
    data
  })
